$(function() {
	$('#tt').edatagrid({
		autoSave : false,
	});
	$('#taskType').combobox("select", -1);
	doSearch();
});

function doSearch() {
	var taskType = $('#taskType').combobox('getValue');
	var currDay = $('#currDay').datebox('getValue');
	var sysVer = $('#sysVer').combobox('getValue');
	var currNum = [];
	var totalNum = [];
	$.ajax({
		url : '/task/taskList',
		data : {
			taskType : taskType,
			currDay : currDay,
			sysVer : sysVer
		},
		type : "POST",
		datatype : "json",
		async : true,
		success : function(data) {
			var currData = eval(data);
			var dayTotal=0, dayExecTotal=0;
			$.each(currData, function(index, mod) {
				totalNum.push(mod.total);
				currNum.push(mod.execTotal);
				dayTotal+=mod.total;
				dayExecTotal+=mod.execTotal;
			});
			taskHandler.showHighChart1(totalNum, currNum, dayTotal, dayExecTotal);
			$('#tt').datagrid('loadData', currData);
		}
	});
}
